<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <div>
        `${111}`
    </div>
</head>
<script>
// 数组去重
    function qc(arr) {
      return [...new Set(arr.map(item => item.name))]
    }
    console.log(
        qc([{name:'a',url:'2',age:4},{name:'a',url:2,age:4},{name:1,url:3},{name:1,url:2}])
    )
    
    function handleArr(list1, list2){
       return list1.filter((ele) => list2.includes(ele.id)).map((ele) => ele.name);
    }
    const list1 = [{id:1,name:'111'},{id:2,name:'222'},{id:3,name:'333'}]
    const list2 = [1,3]
    console.log(handleArr(list1,list2),'handleArr(list1,list2)'); 
</script>
<body>
    
</body>
</html>